#ifndef GTL_GEOMETRY_2D_HEADER_GUARD
#define GTL_GEOMETRY_2D_HEADER_GUARD

#include "gtlCommon.h"
#include "gtlMath.h"
//#include <limits>

/// TODO: Move all functions to "Declarations" and define them later

namespace GTL
{
  namespace Geometry2D
  {

		namespace Just
		{
			template <typename T>
			void Normalize(T& x, T& y)
			{
				T len = Math::SquareRoot(x*x+y*y);
				if (len <= Math::EpsilonValue<T>())
					return;
				x /= len;
				y /= len;
			}

			template <typename T>
			T GetLength(const T& x, const T& y)
			{
				return Math::SquareRoot(x*x+y*y);
			}

			template <typename T>
			T GetAngle(const T& x, const T& y)
			{
				return Math::ArcTan(x, y);
			}
		}

    ///************************************************************************/
    ///* Declarations                                                         */
    ///************************************************************************/

    template <typename T> struct GenericPoint2D;
    template <typename T> struct GenericAngle2D;
    template <typename T> struct GenericRectangle2D;
    template <typename T> struct GenericRay2D;

		#include "gtlGeometry2D_Structures.h"

		#include "gtlGeometry2D_Functions.h"
  }
}
#endif